﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T.FAS.Runtime.DataAccess.SPI
{
    public interface IDataAccessPlugin
    {
        /// <summary>
        /// 插件标识
        /// </summary>
        string PluginCode { get; }
        /// <summary>
        /// 插件可以作用的元数据集合:DataObject EntityObject
        /// </summary>
        List<string> MetaType { get; }
        /// <summary>
        /// 是否允许重复执行
        /// </summary>
        bool IsCanRepeatExecute { get; }
        /// <summary>
        /// 可接受的注入点
        /// </summary>
        int InjectionPoint { get;}
        /// <summary>
        /// 可接受的CRUD类型
        /// </summary>
        int InjectionMethodType { get; }
        /// <summary>
        /// 插件执行上下文
        /// </summary>
        InvokeContext InvokeContext { get; }
        /// <summary>
        /// 初始化插件执行上下文
        /// </summary>
        /// <param name="invokeContext"></param>
        void BuildInvokeContext(InvokeContext invokeContext);
        /// <summary>
        /// 执行插件逻辑
        /// </summary>
        /// <param name="InjectMethodType"></param>
        /// <param name="InjectPoint"></param>
        /// <returns></returns>
        ActionResult Execute(InjectionMethodType InjectMethodType, InjectionPoint InjectPoint, DataAccessPluginExtParam extExecuteData = null);
    }
}
